
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id" data-rule="required" min="0" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label for="c-project_id" class="control-label col-xs-12 col-sm-2">{:__('Project')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-project_id" data-rule="required" data-source="project/index" data-field="name"
                   class="form-control selectpage" name="row[project_id]" type="text" value="" data-format-item="{name} - ¥{default_price}/{unit}">
            <span class="help-block" id="price-help">{:__('Select project to auto fill price')}</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Handler_ids')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-handler_ids" data-rule="required" data-source="handler/handler/index" data-multiple="true" class="form-control selectpage" name="row[handler_ids]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Quantity')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-quantity" data-rule="required" min="0" class="form-control" name="row[quantity]" type="number" value="1">
        </div>
    </div>
    <!-- 单价（自动填充） -->
    <div class="form-group">
        <label for="c-unit_price" class="control-label col-xs-12 col-sm-2">{:__('Unit_price')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-unit_price" data-rule="required" class="form-control" name="row[unit_price]" type="number" step="0.01" min="0" value="0.00">
        </div>
    </div>
    <div class="form-group">
        <label for="c-discount" class="control-label col-xs-12 col-sm-2">{:__('订单折扣')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-discount" data-rule="required;range(0.01~1.00)" class="form-control"
                   name="row[discount]" type="number" step="0.01" min="0.01" max="1.00" value="1.00">
            <span class="help-block">请输入0.01-1.00之间的折扣值（1.00表示原价）</span>
        </div>
    </div>
    <!-- 总金额（自动计算） -->
    <div class="form-group">
        <label for="c-total_amount" class="control-label col-xs-12 col-sm-2">{:__('Total_amount')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-total_amount" class="form-control" name="row[total_amount]" type="text" value="0.00" readonly>
            <span class="help-block" id="amount-help">{:__('Auto calculated amount')}</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-remark" class="form-control" name="row[remark]" type="text" value="">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
